import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooTagController } from '../../../controllers';
const uctootagRouter = new Router();
const tagController = new uctooTagController();

uctootagRouter.post('/add', requireUser, tagController.add);
uctootagRouter.post('/edit', requireUser, rowLevelPermission('uctoo/tag'), tagController.edit);
uctootagRouter.post('/del', requireUser, rowLevelPermission('uctoo/tag'), tagController.delete);

//For getting tag with permission control
uctootagRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/tag'), tagController.getSingle);
uctootagRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/tag'), tagController.getMany);
uctootagRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/tag'), tagController.getMany);

//#endregion AutoCreateCode
export default uctootagRouter;
